Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/network/src/androidMain/kotlin/org/meshtastic/core/network/radio/InterfaceFactory.kt f07624be882e679affc02931dc75e8cb1594de18 (f07624be) Text, 2.63 KB

T8b949e/*
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.network.radio

Tff7b72import T7ee787org.koin.core.annotation.Single
Tff7b72import T7ee787org.meshtastic.core.model.InterfaceId
Tff7b72import T7ee787org.meshtastic.core.repository.RadioInterfaceService
Tff7b72import T7ee787org.meshtastic.core.repository.RadioTransport

T8b949e/**
* Entry point for create radio backend instances given a specific address.
*
* This class is responsible for building and dissecting radio addresses based upon their interface type and the "rest"
* of the address (which varies per implementation).
*/
Tf0883e@Single
Tff7b72class T56d364InterfaceFactoryTb4b4b4(
Tff7b72private Tff7b72val Te6edf3nopInterfaceFactoryTb4b4b4: Te6edf3NopInterfaceFactoryTb4b4b4,
Tff7b72private Tff7b72val Te6edf3mockSpecTb4b4b4: Te6edf3LazyTff7b72<Te6edf3MockInterfaceSpecTff7b72>Tb4b4b4,
Tff7b72private Tff7b72val Te6edf3serialSpecTb4b4b4: Te6edf3LazyTff7b72<Te6edf3SerialInterfaceSpecTff7b72>Tb4b4b4,
Tff7b72private Tff7b72val Te6edf3tcpSpecTb4b4b4: Te6edf3LazyTff7b72<Te6edf3TCPInterfaceSpecTff7b72>Tb4b4b4,
Tb4b4b4) Tb4b4b4{
Tff7b72internal Tff7b72val Te6edf3nopInterface Tff7b72by Te6edf3lazy Tb4b4b4{ Te6edf3nopInterfaceFactoryTb4b4b4.Te6edf3createTb4b4b4(Ta5d6ff"Ta5d6ff"Tb4b4b4) Tb4b4b4}

Tff7b72private Tff7b72val Te6edf3specMapTb4b4b4: Te6edf3MapTff7b72<Te6edf3InterfaceIdTb4b4b4, Te6edf3InterfaceSpecTff7b72<Tff7b72*Tff7b72>Tff7b72>
Tff7b72getTb4b4b4(Tb4b4b4) Tff7b72=
Te6edf3mapOfTb4b4b4(
Te6edf3InterfaceIdTb4b4b4.Te6edf3MOCK Te6edf3to Te6edf3mockSpecTb4b4b4.Te6edf3valueTb4b4b4,
Te6edf3InterfaceIdTb4b4b4.Te6edf3NOP Te6edf3to Te6edf3NopInterfaceSpecTb4b4b4(Te6edf3nopInterfaceFactoryTb4b4b4)Tb4b4b4,
Te6edf3InterfaceIdTb4b4b4.Te6edf3SERIAL Te6edf3to Te6edf3serialSpecTb4b4b4.Te6edf3valueTb4b4b4,
Te6edf3InterfaceIdTb4b4b4.Te6edf3TCP Te6edf3to Te6edf3tcpSpecTb4b4b4.Te6edf3valueTb4b4b4,
Tb4b4b4)

Tff7b72fun Td2a8fftoInterfaceAddressTb4b4b4(Te6edf3interfaceIdTb4b4b4: Te6edf3InterfaceIdTb4b4b4, Te6edf3restTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Tffa657String Tff7b72= Ta5d6ff"Tffd700${Te6edf3interfaceIdTb4b4b4.Te6edf3idTffd700}Tffd700$Te6edf3restTa5d6ff"

Tff7b72fun Td2a8ffcreateInterfaceTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4, Te6edf3serviceTb4b4b4: Te6edf3RadioInterfaceServiceTb4b4b4)Tb4b4b4: Te6edf3RadioTransport Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3specTb4b4b4, Te6edf3restTb4b4b4) Tff7b72= Te6edf3splitAddressTb4b4b4(Te6edf3addressTb4b4b4)
Tff7b72return Te6edf3specTff7b72?.Te6edf3createInterfaceTb4b4b4(Te6edf3restTb4b4b4, Te6edf3serviceTb4b4b4) Tff7b72?: Te6edf3nopInterface
Tb4b4b4}

Tff7b72fun Td2a8ffaddressValidTb4b4b4(Te6edf3addressTb4b4b4: Tffa657String?Tb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72= Te6edf3addressTff7b72?.Te6edf3let Tb4b4b4{
Tff7b72val Tb4b4b4(Te6edf3specTb4b4b4, Te6edf3restTb4b4b4) Tff7b72= Te6edf3splitAddressTb4b4b4(Tffa657itTb4b4b4)
Te6edf3specTff7b72?.Te6edf3addressValidTb4b4b4(Te6edf3restTb4b4b4)
Tb4b4b4} Tff7b72?: Tff7b72false

Tff7b72private Tff7b72fun Td2a8ffsplitAddressTb4b4b4(Te6edf3addressTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3PairTff7b72<Te6edf3InterfaceSpecTff7b72<Tff7b72*Tff7b72>Tff7b72?Tb4b4b4, Tffa657StringTff7b72> Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3addressTb4b4b4.Te6edf3isEmptyTb4b4b4(Tb4b4b4)Tb4b4b4) Tff7b72return Te6edf3PairTb4b4b4(Tff7b72nullTb4b4b4, Ta5d6ff"Ta5d6ff"Tb4b4b4)
Tff7b72val Te6edf3c Tff7b72= Te6edf3addressTff7b72[T79c0ff0Tff7b72]Tb4b4b4.Te6edf3let Tb4b4b4{ Te6edf3InterfaceIdTb4b4b4.Te6edf3forIdCharTb4b4b4(Tffa657itTb4b4b4) Tb4b4b4}Tff7b72?.Te6edf3let Tb4b4b4{ Te6edf3specMapTff7b72[Tffa657itTff7b72] Tb4b4b4}
Tff7b72val Te6edf3rest Tff7b72= Te6edf3addressTb4b4b4.Te6edf3substringTb4b4b4(T79c0ff1Tb4b4b4)
Tff7b72return Te6edf3PairTb4b4b4(Te6edf3cTb4b4b4, Te6edf3restTb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.1 - Generated in 0.06s